package com.itheima.pojo;

public class Result {
    private Integer code;
    private String msg;
    private Object date;

    public Result() {
    }

    public Result(Integer code, String msg, Object date) {
        this.code = code;
        this.msg = msg;
        this.date = date;
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getDate() {
        return date;
    }

    public void setDate(Object date) {
        this.date = date;
    }

    @Override
    public String toString() {
        return "Result{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", date=" + date +
                '}';
    }
    public static Result success(Object date){
        return new Result(1,"successful",date);
    }
    public static Result success() {
        return new Result(1, "successful", null);
    }
    public static Result error(String msg){
        return new Result(0,msg,null);
    }

}
